package com.cocos.game.zdkj;


import android.util.Log;

import com.google.firebase.crashlytics.FirebaseCrashlytics;

import java.util.Map;

public class BugReportAgent {

    public static void postException(String location, String name, String reason, String stack){
        Log.e("Cocos", "BugReportAgent.postException: " + location + " " + name + " " + reason);
        postException(location, name, reason, stack, null);
    }

    public static void postException(String location, String name, String reason, String stack, Map<String, String> extraInfo){
        String message = "ZdkjCocoException{" +
                "location=" + location +
                ", name='" + name + '\'' +
                ", reason='" + reason + '\'' +
                ", stack='" + stack + '\'' +
                ", extraInfo=" + extraInfo +
                '}';
        FirebaseCrashlytics.getInstance().recordException(new ZdkjCocoException(message));
    }

    public static class ZdkjCocoException extends Exception{
        public ZdkjCocoException(String message){
            super(message);
        }
    }
}